<template>
  <div id="lists">
    <app-head>List</app-head>
    <table class="table">
      <thead>
        <tr>
          <th>id</th>
          <th>name</th>
          <th>age</th>
        </tr>
      </thead>
      <tbody>
        <tr v-for="list in allList.data" :key="list.id">
          <td>{{ list.id }}</td>
          <td>{{ list.name }}</td>
          <td>{{ list.age }}</td>
        </tr>
      </tbody>
    </table>
  </div>
</template>

<script>
import Head from '@/components/common/Head'
import { mapGetters, mapActions } from 'vuex'

export default {
  name: 'Lists',
  methods: {
    ...mapActions(['fetchLists'])
  },
  computed: mapGetters(['allList']),
  created() {
    this.fetchLists()
  },
  components: {
    'app-head': Head
  }
}
</script>

<style>
</style>
